package open.template.work.commons.exception;

public class BaseTemplateException extends RuntimeException{


    private String code;

    private String message;

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public BaseTemplateException(String code) {
        this.code = code;
    }

    public BaseTemplateException(ExceptionCodeEnum code) {
        this.code = code.name();
        this.message=code.getDesc();
    }


    public BaseTemplateException() {
    }

    @Override
    public String toString() {
        return "{" +
                "code='" + code + '\'' +
                ", message='" + message + '\'' +
                '}';
    }
}
